MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / showFilterMenu

Method showFilterMenu

Gui/SequenceFileDialog.cpp:1890–1928  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1888}
1889
1890void
1891SequenceFileDialog::showFilterMenu()
1892{
1893 assert( _filterLineEdit->parentWidget() );
1894 QPoint position( _filterLineEdit->parentWidget()->mapToGlobal( _filterLineEdit->pos() ) );
1895
1896 position.ry() += _filterLineEdit->height();
1897 QList<QAction *> actions;
1898
1899 //QFont font(appFont,appFontSize);
1900 QFontMetrics fm( font() );
1901
1902 QStringList filters = _filters;
1903 if (filters.size() > 1) {
1904 // make sure *.* is first if we got multiple filters (for easy access)
1905 filters.prepend( QString::fromUtf8("*.*") );
1906 } else {
1907 filters << QString::fromUtf8("*.*");
1908 }
1909 filters << QString::fromUtf8("*/") << QString::fromUtf8("*") << QString::fromUtf8(".*");
1910
1911 for (int i = 0; i < filters.size(); ++i) {
1912 QString filter = filters[i];
1913 if ( !filter.contains( QString::fromUtf8("*") ) ) {
1914 filter.prepend( QString::fromUtf8("*.") );
1915 }
1916 QAction *filterAction = new QAction(filter, this);
1917 QObject::connect( filterAction, SIGNAL(triggered()), this, SLOT(handleFilterSlot()) );
1918 actions.append(filterAction);
1919 }
1920
1921 if (actions.count() > 0) {
1922 Menu menu(_filterLineEdit);
1923 //menu.setFont(font);
1924 menu.addActions(actions);
1925 // menu.setFixedSize( _filterLineEdit->width(),menu.sizeHint().height() );
1926 menu.exec(position);
1927 }
1928}
1929
1930void
1931SequenceFileDialog::handleFilterSlot()

Callers

nothing calls this directly

Calls 7

fontFunction · 0.85
appendMethod · 0.80
heightMethod · 0.45
sizeMethod · 0.45
containsMethod · 0.45
countMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected