CInputdialogBrowseWaregroup::CInputdialogBrowseWaregroup(QWidget *parent) :
    QDialog(parent),
    m_ui(new Ui::CInputdialogBrowseWaregroup)
{
    m_ui->setupUi(this);
    m_pThread=NULL;
    settings(false);//load & set settings
    m_ui->treeWidget->hideColumn(2);//id column
    m_ui->treeWidget->hideColumn(3);//parent_id column
    m_ui->treeWidget->setSortingEnabled(false);
    m_ui->treeWidget->setColumnWidth(0,300);
    m_ui->treeWidget->setColumnWidth(1,300);
    //-
    setMaximumSize(width(),height());
    setMinimumSize(width(),height());
}
示例#2
0
void QScreen::createDisplay()
{
    if (m_image != 0)
    {
        delete m_image;
        m_image = 0;
    }

    int cxScreenWidth, cyScreenHeight;
    Emulator_GetScreenSize(m_mode, &cxScreenWidth, &cyScreenHeight);

    m_image = new QImage(cxScreenWidth, cyScreenHeight, QImage::Format_RGB32);

    setMinimumSize(cxScreenWidth + 8, cyScreenHeight + 8);
    setMaximumSize(cxScreenWidth + 100, cyScreenHeight + 20);
}
示例#3
0
ProblemDialog::ProblemDialog(ProblemInfo *problemInfo, bool isNewProblem, QWidget *parent) : QDialog(parent)
{
    logMessage("ProblemDialog::ProblemDialog()");

    m_isNewProblem = isNewProblem;
    m_problemInfo = problemInfo;

    setWindowTitle(tr("Problem properties"));

    createControls();

    load();

    setMinimumSize(sizeHint());
    setMaximumSize(sizeHint());
}
示例#4
0
void ZoneViewWidget::resizeToZoneContents()
{
    QRectF zoneRect = zone->getOptimumRect();
    qreal totalZoneHeight = zoneRect.height();
    if (zoneRect.height() > 500)
        zoneRect.setHeight(500);
    QSizeF newSize(qMax(QGraphicsWidget::layout()->effectiveSizeHint(Qt::MinimumSize, QSizeF()).width(), zoneRect.width() + scrollBar->width() + 10), zoneRect.height() + extraHeight + 10);
    setMaximumSize(newSize);
    resize(newSize);
    
    zone->setGeometry(QRectF(0, -scrollBar->value(), zoneContainer->size().width(), totalZoneHeight));
    scrollBar->setMaximum(totalZoneHeight - zoneRect.height());
    
    if (layout())
        layout()->invalidate();
}
示例#5
0
GuiSetBorder::GuiSetBorder(QWidget * parent, Qt::WindowFlags fl)
	: QWidget(parent, fl), buffer(75, 75)
{
	/* length of corner line */
	l = buffer.width() / 10;
	/* margin */
	m = buffer.height() / 10;

	w = buffer.width();
	h = buffer.height();

	init();

	setMinimumSize(w,h);
	setMaximumSize(w,h);
}
示例#6
0
MinimizeButton::MinimizeButton(QWidget *parent)
	:QPushButton(parent)
{
	setMinimumSize(25, 25);
	setMaximumSize(25, 25);

	setStyleSheet("MinimizeButton{"
		"background-image: url(:/images/minimize1.png);}"
		"MinimizeButton:hover{"
		"background-image: url(:/images/minimize2.png);}"
		"MinimizeButton:pressed{"
		"background-image: url(:/images/minimize2.png);}"
		);
	setToolTip("Minimize the window");
	setFlat(true);
}
示例#7
0
void UIYabause::fullscreenRequested( bool f )
{
	if ( isFullScreen() && !f )
	{
#ifdef USE_UNIFIED_TITLE_TOOLBAR
		setUnifiedTitleAndToolBarOnMac( true );
#endif
		toggleFullscreen(0, 0, false, -1 );
		showNormal();

		VolatileSettings* vs = QtYabause::volatileSettings();
		int menubarHide = vs->value( "View/Menubar" ).toInt();
		if ( menubarHide == BD_HIDEFS ||
			  menubarHide == BD_SHOWONFSHOVER)
			menubar->show();
		if ( vs->value( "View/Toolbar" ).toInt() == BD_HIDEFS )
			toolBar->show();

		setCursor(Qt::ArrowCursor);
		hideMouseTimer->stop();
	}
	else if ( !isFullScreen() && f )
	{
#ifdef USE_UNIFIED_TITLE_TOOLBAR
		setUnifiedTitleAndToolBarOnMac( false );
#endif
		VolatileSettings* vs = QtYabause::volatileSettings();

		setMaximumSize( QWIDGETSIZE_MAX, QWIDGETSIZE_MAX );
		setMinimumSize( 0,0 );

		toggleFullscreen(vs->value("Video/FullscreenWidth").toInt(), vs->value("Video/FullscreenHeight").toInt(), 
						f, vs->value("Video/VideoFormat").toInt());

		showFullScreen();

		if ( vs->value( "View/Menubar" ).toInt() == BD_HIDEFS )
			menubar->hide();
		if ( vs->value( "View/Toolbar" ).toInt() == BD_HIDEFS )
			toolBar->hide();

		hideMouseTimer->start(3 * 1000);
	}
	if ( aViewFullscreen->isChecked() != f )
		aViewFullscreen->setChecked( f );
	aViewFullscreen->setIcon( QIcon( f ? ":/actions/no_fullscreen.png" : ":/actions/fullscreen.png" ) );
}
示例#8
0
MainWindow::MainWindow(QWidget *parent)
    : QWidget(parent, Qt::FramelessWindowHint |
                      Qt::WindowSystemMenuHint |
                      Qt::WindowStaysOnTopHint),
      dragPosition(),
      worker_thread_(NULL),
      gui_update_thread_(this),
      logo_rotation_timer(NULL)
{
    setWindowTitle("Loudness Drop");

    setMinimumSize(130, 130);
    setMaximumSize(0, 0);
    setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    QAction *quitAction = new QAction(tr("E&xit"), this);
    quitAction->setShortcut(tr("Ctrl+Q"));
    connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
    addAction(quitAction);

    setContextMenuPolicy(Qt::ActionsContextMenu);

    QVBoxLayout *layout = new QVBoxLayout;
    layout->setMargin(0);
    layout->setSpacing(0);
    render_area_ = new RenderArea;
    progress_bar_ = new QProgressBar;
    progress_bar_->setFixedHeight(15);
    progress_bar_->setMaximum(130);
    progress_bar_->setTextVisible(false);

    layout->addWidget(render_area_);
    layout->addWidget(progress_bar_);
    setLayout(layout);

    setAcceptDrops(true);

    connect(&gui_update_thread_, SIGNAL(setProgressBar(int)),
            this, SLOT(setProgressBar(int)));
    connect(&gui_update_thread_, SIGNAL(rotateLogo()),
            this, SLOT(rotateLogo()));
    connect(&gui_update_thread_, SIGNAL(resetLogo()),
            this, SLOT(resetLogo()));
    connect(this, SIGNAL(stopGUIThread()),
            &gui_update_thread_, SLOT(stopThread()));
    gui_update_thread_.start();
}
/**
 * MIPSarch contructor.
 * Creates and sets the MIPSarchcanvas to be displayed, and some
 * GUI functionalities.
 */
MIPSarch::MIPSarch( mips &m, QWidget* parent,  const char* name, Qt::WFlags fl )
    : Q3CanvasView(0, parent, name, fl )
{   
    archCanvas=new MIPSarchCanvas(m,this);
    setCanvas(archCanvas);

    setIcon(QPixmap("mips.xpm"));

    resize(QSize(896+5,455+5));
    setMaximumSize(QSize(896+5,455+5));

    cursor=new QCursor(Qt::PointingHandCursor);
    setCursor(*cursor);

    viewport()->setMouseTracking(true);
    setFocusPolicy(Qt::StrongFocus);
}
示例#10
0
Ui::Dialog_About::Dialog_About(QWidget *parent): QDialog(parent) {
	setObjectName("Dialog_About");
	setWindowTitle("About");
	resize(380, 312);
	setMaximumSize(380, 312);
	setMinimumSize(380, 312);
	QIcon aboutIcon(":/img/bp-nfoview.png");
	setWindowIcon(aboutIcon);

	ilabel = new QLabel(this);
	ilabel->setGeometry(5,5,370,64);
	ilabel->setPixmap(QPixmap(":/img/bp-nfoview.png").scaled(64,64,Qt::KeepAspectRatio));
	ilabel->setAlignment(Qt::AlignCenter);

	buttonBox = new QDialogButtonBox(this);
	buttonBox->setGeometry(QRect(5, 280, 370, 32));
	buttonBox->setOrientation(Qt::Horizontal);
	buttonBox->setStandardButtons(QDialogButtonBox::Close);
	buttonBox->setCenterButtons(true);
	buttonBox->setObjectName("buttonBox");

	label = new QLabel(this);
	label->setGeometry(QRect(5, 64, 370, 220));
	label->setAlignment(Qt::AlignCenter);
	label->setWordWrap(true);
	label->setOpenExternalLinks(true);
	label->setObjectName("label");

	QString aboutText("<span style=\"font-size:16pt;\"><b>bp-nfoview ");
	aboutText += MAIN_VERSION;
	aboutText += "</b></span><br>A simple lightweight nfo-viewer written in C++ using Qt4 for its interface<br>";

	aboutText += "<br>\nits also using:\n";
	aboutText += "<br>Codepage437Codec ";
	aboutText += QCODEPAGE437CODEC_VERSION;

	aboutText += "<br>AboutDialog ";
	aboutText += DIALOG_ABOUT_VERSION;

	aboutText += "<br><br>Copyright (c) 2010-2013 &lt;[email protected]&gt; <br>licensed under GPL-3<br> See <a href=\"http://www.gnu.org/licenses/gpl.html\">http://www.gnu.org/licenses/</a> for more info";
	label->setText(aboutText);

	connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
	connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
	QMetaObject::connectSlotsByName(this);
}
示例#11
0
RunButton::RunButton(TestItem * item, QWidget * parent) :
    QPushButton(parent),
    item_(item)
{
    // Set style
    setMinimumSize(16, 16);
    setMaximumSize(16, 16);
    setIcon(QIcon(":/runicon.png"));
    setFlat(true);
    setStyleSheet(runButtonStyleSheet);

    // Prevent keyboard focus (so the focus is always on the TreeView
    setFocusPolicy(Qt::NoFocus);

    // Run test when clicked
    connect(this, &RunButton::clicked, this, &RunButton::onClicked_);
}
示例#12
0
WageDialog::WageDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::WageDialog)
{
    ui->setupUi(this);
    ui->setupUi(this);
    this->setWindowTitle("工资查询");       //设置标题
    QIcon icon = QIcon(":/image/manage.ico");//注意修改这里的图片目录
    setWindowIcon(icon);

    setMaximumSize(490,360);
    setMinimumSize(490,360);

    setWindowFlags(Qt::CustomizeWindowHint|Qt::WindowCloseButtonHint);//去掉窗口上的问号

    QObject::connect(ui->ReturnButton,SIGNAL(clicked()),this,SLOT(ReturnSlot()));       //返回信号与槽
}
SearchDialogMainWidgetData::SearchDialogMainWidgetData
(
	QWidget* parent,
	const char* name
)
	:
	Inherited( parent, name, 0 )
{
	comboSelector = new QComboBox( FALSE, this, "ComboBoxSelector" );
	comboSelector->setGeometry( 0, 0, 250, 33 );
	comboSelector->setMinimumSize( 10, 10 );
	comboSelector->setMaximumSize( 32767, 32767 );
	comboSelector->setSizeLimit( 10 );
	comboSelector->setAutoResize( FALSE );

	labelMatches = new QLabel( this, "LabelMatches" );
	labelMatches->setGeometry( 0, 33, 250, 23 );
	labelMatches->setMinimumSize( 10, 10 );
	labelMatches->setMaximumSize( 32767, 32767 );
	labelMatches->setText( "matches" );
	labelMatches->setAlignment( 292 );
	labelMatches->setMargin( -1 );

	lePattern = new QLineEdit( this, "LineEditPattern" );
	lePattern->setGeometry( 0, 56, 250, 24 );
	lePattern->setMinimumSize( 10, 10 );
	lePattern->setMaximumSize( 32767, 32767 );
	lePattern->setText( "*" );
	lePattern->setMaxLength( 32767 );
	lePattern->setEchoMode( QLineEdit::Normal );
	lePattern->setFrame( TRUE );

	QBoxLayout* dlgedit_layout_1 = new QBoxLayout( this, QBoxLayout::TopToBottom, 0, 0, 0L );
	dlgedit_layout_1->addStrut( 0 );
	QBoxLayout* dlgedit_layout_1_1 = new QBoxLayout( QBoxLayout::TopToBottom, 0, 0L );
	dlgedit_layout_1->addLayout( dlgedit_layout_1_1, 1 );
	dlgedit_layout_1_1->addStrut( 0 );
	dlgedit_layout_1_1->addWidget( comboSelector, 5, 36 );
	dlgedit_layout_1_1->addWidget( labelMatches, 3, 36 );
	dlgedit_layout_1_1->addWidget( lePattern, 3, 36 );


	resize( 250,80 );
	setMinimumSize( 0, 0 );
	setMaximumSize( 32767, 32767 );
}
示例#14
0
GameWidget::GameWidget(int size_of_field, int cell_size, QWidget* widget) 
    : QWidget(widget), 
    cell_size(cell_size), field_size(size_of_field) {

    game = NULL;

    qDebug() << "game widget constructor";

    slotSetPlayerVsCPU();

    resize(size_of_field * cell_size + 1, size_of_field * cell_size + 1);
    setMinimumSize(size());
    setMaximumSize(size());

    ip = "0.0.0.0";
    port = 8080;
}
示例#15
0
TCircleButton::TCircleButton(int diameter, bool animate, QWidget *parent) : QPushButton(parent), m_diameter(diameter)
{
    show();

    m_pix = QPixmap(new_xpm);
    
    setIcon(m_pix);
    
    paintMask();
    
    setMaximumSize(m_diameter, m_diameter);
    
    m_animator = new Animator;
    
    if (animate)
        connect(m_animator->aTimer, SIGNAL(timeout()), this, SLOT(animate()));
}
示例#16
0
squareToolDock::squareToolDock(QWidget* parent)
  : constWidthDock(parent), detailDock_(NULL) {

  dockLayout_ = new QVBoxLayout(this);
  setLayout(dockLayout_);

  toolLayout_ = new QGridLayout();

  // toolLayout_ uses smaller icons by default
  // apparently every button has to be set individually...
  const int iconDimension = style()->pixelMetric(QStyle::PM_ToolBarIconSize);
  const QSize iconSize(iconDimension, iconDimension);
  constructTools(iconSize);

  toolColorLabel_ = new mousePressLabel(this);
  toolColorLabel_->setFixedSize(swatchSize());
  toolColorLabel_->setFrameStyle(QFrame::Panel | QFrame::Raised);
  toolColorLabel_->setLineWidth(3);
  toolColorLabel_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
  toolColorLabel_->setAlignment(Qt::AlignCenter);
  QPixmap qpm = QPixmap(swatchSize());
  qpm.fill(Qt::black);
  toolColorLabel_->setPixmap(qpm);
  toolColorLabel_->setEnabled(false);
  connect(toolColorLabel_, SIGNAL(mousePressed()),
          this, SLOT(processToolLabelMousePressed()));

  toolLabelLayout_ = new QHBoxLayout();
  dockLayout_->addLayout(toolLabelLayout_);
  toolLabelLayout_->addWidget(toolColorLabel_);

  dockLayout_->addLayout(toolLayout_);

  flossTypeBox_ = new QComboBox(this);
  connect(flossTypeBox_, SIGNAL(currentIndexChanged(int )),
          this, SLOT(processFlossTypeBoxChange(int )));
  const QList<flossType> types = flossType::flossTypes();
  for (int i = 0, size = types.size(); i < size; ++i) {
    flossTypeBox_->addItem(types[i].text(),
                           QVariant::fromValue(types[i]));
  }
  dockLayout_->addWidget(flossTypeBox_);

  setMinimumSize(sizeHint());
  setMaximumSize(sizeHint());
}
示例#17
0
ColorWheel::ColorWheel(QWidget* parent) :
    QWidget(parent),
    initSize_(200,200),
    mouseDown_(false),
    margin_(0),
    wheelWidth_(30),
    currentColor_(Qt::red),
    inWheel_(false),
    inSquare_(false) {
    
    currentColor_ = currentColor_.toHsv();
    updateSquareImage(currentColor_.hue());

    setMinimumSize(initSize_);
    setMaximumSize(initSize_);
    setCursor(Qt::CrossCursor);
}
示例#18
0
MoveWidget::MoveWidget(QWidget *parent)
    : QFrame(parent, Qt::FramelessWindowHint|Qt::Tool|Qt::X11BypassWindowManagerHint), m_move(false)
{

    Q_ASSERT(parent);
    parent->installEventFilter(this);
    setCursor(Qt::SizeAllCursor);

    setMaximumSize(50, 30);
    setMinimumSize(maximumSize());

    setMouseTracking(true);
    setFrameStyle(QFrame::Panel|QFrame::Plain);

    setVisible(parentWidget()->isVisible());

}
示例#19
0
/**
 * @brief TextBubbleSlider::TextBubbleSlider Constructs a text-bubble slider that copys
 * all relevant data from the previous slider
 * @param copySlider
 * @param parent
 */
TextBubbleSlider::TextBubbleSlider(QSlider *copySlider, QWidget *parent) :
    QSlider(parent)
{
    construct();

    hidden = false;

    // Copy settings
    setSizePolicy(copySlider->sizePolicy());
    setMinimumSize(copySlider->minimumSize());
    setMaximumSize(copySlider->maximumSize());
    setFocusPolicy(copySlider->focusPolicy());
    setOrientation(copySlider->orientation());
    setMaximum(copySlider->maximum());
    setMinimum(copySlider->minimum());
    setToolTip(copySlider->toolTip());
}
示例#20
0
SearchDialog::SearchDialog(QWidget * parent) : BaseDialog(parent), ui(new Ui::SearchDialog) {
    ui -> setupUi(this);

    QGridLayout * newLayout = new QGridLayout(this);
    QLabel * err_output = new QLabel(this);

    configurator = new Controls::SearchConfigurator(this, ui -> acceptButton, err_output);

    newLayout -> addWidget(err_output, 0, 0, 1, 2);
    newLayout -> addWidget(configurator, 1, 0, 1, 2);
    newLayout -> addWidget(ui -> cancelButton, 2, 0);
    newLayout -> addWidget(ui -> acceptButton, 2, 1);
    setLayout(newLayout);

    setMinimumSize(480, 480);
    setMaximumSize(480, 480);
}
示例#21
0
QNWindow::QNWindow(QWidget *parent) :
    QWidget(parent)
{
    //row 1
    fileNameLabel = new QLabel("File");
    fileNameLabel->setFixedWidth(35);
    fileNameEdit = new QLineEdit;
    browseFileBtn = new QPushButton("...");

    QHBoxLayout *layout1=new QHBoxLayout;
    layout1->addWidget(fileNameLabel);
    layout1->addWidget(fileNameEdit);
    layout1->addWidget(browseFileBtn);

    //row 2
    fileETagLabel = new QLabel("ETag");
    fileETagLabel->setFixedWidth(35);
    fileEtagEdit = new QLineEdit;

    QHBoxLayout *layout2=new QHBoxLayout;
    layout2->addWidget(fileETagLabel);
    layout2->addWidget(fileEtagEdit);

    //row 3
    calcETagBtn = new QPushButton("Calculate");
    QHBoxLayout *layout3=new QHBoxLayout;
    layout3->addStretch();
    layout3->addWidget(calcETagBtn);

    QVBoxLayout *mainLayout=new QVBoxLayout;
    mainLayout->addLayout(layout1);
    mainLayout->addLayout(layout2);
    mainLayout->addLayout(layout3);

    setLayout(mainLayout);
    QSize size(450,160);
    setMinimumSize(size);
    setMaximumSize(size);

    openFileDialog=new QFileDialog(this);
    QObject::connect(openFileDialog,SIGNAL(fileSelected(QString)),this,SLOT(onFileSelected(QString)));

    QObject::connect(calcETagBtn,SIGNAL(clicked()),this,SLOT(calBtnClicked()));
    QObject::connect(browseFileBtn,SIGNAL(clicked()),this,SLOT(browseBtnClicked()));

}
示例#22
0
TabBarWidget::TabBarWidget(QWidget *parent) : QTabBar(parent),
	m_previewWidget(NULL),
	m_tabSize(0),
	m_maximumTabSize(40),
	m_minimumTabSize(250),
	m_pinnedTabsAmount(0),
	m_clickedTab(-1),
	m_hoveredTab(-1),
	m_previewTimer(0),
	m_showCloseButton(true),
	m_showUrlIcon(true),
	m_enablePreviews(true)
{
	qRegisterMetaType<WindowLoadingState>("WindowLoadingState");
	setDrawBase(false);
	setExpanding(false);
	setMovable(true);
	setSelectionBehaviorOnRemove(QTabBar::SelectPreviousTab);
	setElideMode(Qt::ElideRight);
	setMouseTracking(true);
	setDocumentMode(true);
	setMaximumSize(0, 0);
	setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
	setStyle(new TabBarStyle());

	m_closeButtonPosition = static_cast<QTabBar::ButtonPosition>(QApplication::style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition));
	m_iconButtonPosition = ((m_closeButtonPosition == QTabBar::RightSide) ? QTabBar::LeftSide : QTabBar::RightSide);

	optionChanged(QLatin1String("TabBar/ShowCloseButton"), SettingsManager::getValue(QLatin1String("TabBar/ShowCloseButton")));
	optionChanged(QLatin1String("TabBar/ShowUrlIcon"), SettingsManager::getValue(QLatin1String("TabBar/ShowUrlIcon")));
	optionChanged(QLatin1String("TabBar/EnablePreviews"), SettingsManager::getValue(QLatin1String("TabBar/EnablePreviews")));
	optionChanged(QLatin1String("TabBar/MaximumTabSize"), SettingsManager::getValue(QLatin1String("TabBar/MaximumTabSize")));
	optionChanged(QLatin1String("TabBar/MinimumTabSize"), SettingsManager::getValue(QLatin1String("TabBar/MinimumTabSize")));

	ToolBarWidget *toolBar = qobject_cast<ToolBarWidget*>(parent);

	if (toolBar)
	{
		setArea(toolBar->getArea());

		connect(toolBar, SIGNAL(areaChanged(Qt::ToolBarArea)), this, SLOT(setArea(Qt::ToolBarArea)));
	}

	connect(SettingsManager::getInstance(), SIGNAL(valueChanged(QString,QVariant)), this, SLOT(optionChanged(QString,QVariant)));
	connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int)));
}
void NotificationLayout::checkHeight()
{
    int h = 0;
    QHashIterator<uint, Notification*> it(m_notifications);
    while (it.hasNext())
    {
        it.next();
        // *2 is mandatory here to prevent cropping of widgets
        //  with enforced small height
        h += it.value()->height() + m_layout->spacing() * 2;
    }

    setMinimumSize(width(), h);
    setMaximumSize(width(), h);

    emit heightChanged(h);
}
示例#24
0
文件: itemnotes.cpp 项目: Ack0/CopyQ
void ItemNotes::updateSize(const QSize &maximumSize, int idealWidth)
{
    setMaximumSize(maximumSize);

    if (m_notes) {
        const int w = maximumSize.width() - 2 * notesIndent - 8;
        QTextDocument *doc = m_notes->document();
        doc->setTextWidth(w);
        m_notes->setFixedSize( doc->idealWidth() + 16, doc->size().height() );
    }

    if ( !m_childItem.isNull() )
        m_childItem->updateSize(maximumSize, idealWidth);

    adjustSize();
    setFixedSize(sizeHint());
}
示例#25
0
FindDialog::FindDialog(QWidget *parent)
    : QDialog(parent)
{
	resize(QSize(300 , 200).expandedTo(minimumSizeHint()));
	setMinimumSize(QSize(350 , 200).expandedTo(minimumSizeHint()));
	setMaximumSize(QSize(350 , 200).expandedTo(minimumSizeHint()));
    
    this->parent = parent;
    
    createDesign();
    
    connect(pushButtonClose, SIGNAL(clicked()), this, SLOT(close()));
    connect(pushButtonFind, SIGNAL(clicked()), parent, SLOT(findText()));
    connect(pushButtonFind, SIGNAL(clicked()), this, SLOT(close()));
    
    setWindowTitle(tr("Find..."));
}
示例#26
0
ClsQStateArrayViewRect::ClsQStateArrayViewRect( QWidget *parent, ClsBaseTopology *_clsBaseTopologyGroup,
						const char *_name, unsigned int _iSelectionMode ) :
    ClsBaseQStateArrayView(parent, _clsBaseTopologyGroup, _name, _iSelectionMode) {
#ifdef DEBUG_CLSQSTATEARRAYVIEWRECT
    cout << "ClsQStateArrayViewRect( QWidget *parent, ClsBaseTopology *_clsBaseTopologyGroup, const char *_name, unsigned int _iSelectionMode ) " << endl;
#endif

    iCellSize = 20;
    iNrCellsX = 10;
    iNrCellsY = 10;

    ParameterList parameterList = _clsBaseTopologyGroup->getListParameters();

    while (parameterList.size()) {
	string strParamName = parameterList.front()->getName();
	string strParamValue = parameterList.front()->getValueAsString();
	if(!strParamName.compare(ClsTagLibrary::TopologyWidthTag())) {
	    iNrCellsX = iqrUtils::string2int(strParamValue);
	}
	else if(!strParamName.compare(ClsTagLibrary::TopologyHeightTag())) {
	    iNrCellsY =  iqrUtils::string2int(strParamValue);
	}
	parameterList.pop_front();
    }

    iCellSize = iSizeMax / (iNrCellsX > iNrCellsY ? iNrCellsX : iNrCellsY);
    if(iCellSize <=1){
	iCellSize = 2;
    }

    vCells.resize(iNrCellsX+1);
    for(int ii=0; ii<(iNrCellsX + 1);ii++){
	vCells[ii].resize(iNrCellsY+1);
    }

    this->setFrameStyle(  QFrame::WinPanel | QFrame::Raised );

    setMinimumSize( iNrCellsX * iCellSize + 2 * BORDER , iNrCellsY * iCellSize + 2 * BORDER );
    setMaximumSize( iNrCellsX * iCellSize + 2 * BORDER , iNrCellsY * iCellSize + 2 * BORDER );

    clear();
    createNullPixmap();


}
Variable::Variable( QWidget * parent):QDialog(parent)
{
    setupUi(this);
    QPalette bgpal;
    QSettings settings;
    int red,green,blue;
    red=settings.value("red/window",152).toInt();
    green=settings.value("green/window",204).toInt();
    blue=settings.value("blue/window",222).toInt();
    bgpal.setColor(QPalette::Background, QColor(red,green,blue));
    setPalette(bgpal);
    red=settings.value("red/textview",206).toInt();
    green=settings.value("green/textview",224).toInt();
    blue=settings.value("blue/textview",255).toInt();
    bgpal.setColor(QPalette::Base,QColor(red,green,blue));
    tableWidget->setPalette(bgpal);
    QVBoxLayout *mainLayout = new QVBoxLayout(this);
    QHBoxLayout *hlayout = new QHBoxLayout();
    hlayout->addStretch();
    hlayout->addWidget(clearButton);
    hlayout->addWidget(calcButton);
    mainLayout->addWidget(tableWidget);
    mainLayout->addLayout(hlayout);

    setMinimumSize(255,200);
    setMaximumSize(255,200);
    tableWidget->setColumnWidth(1,140);
    tableWidget->setCurrentCell(0,1);
    tableWidget->verticalHeader()->setVisible(false);
    if(settings.value("Variable_X_Bool",0).toBool())
    {
        tableWidget->setItem(0,1,new QTableWidgetItem(settings.value("Variable_X_Value").toString()));
        tableWidget->item(0,1)->setTextAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
    }
    if(settings.value("Variable_Y_Bool",0).toBool())
    {
        tableWidget->setItem(1,1,new QTableWidgetItem(settings.value("Variable_Y_Value").toString()));
        tableWidget->item(1,1)->setTextAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
    }
    if(settings.value("Variable_Z_Bool",0).toBool())
    {
        tableWidget->setItem(2,1,new QTableWidgetItem(settings.value("Variable_Z_Value").toString()));
        tableWidget->item(2,1)->setTextAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
    }
}
/** This method is called, if the window has been resized.
 *  If the drawing previously has fit into the window, it is rescaled to the new window size.
 */
void
SystemTopologyDrawing::setSize( const QSize &size )
{
    int   eps      = 50;
    QSize drawSize = getDrawingSize();
    bool  doesFit  = ( ( ( drawSize.width() - parentSize.width() ) < eps ) &&
                       ( ( drawSize.height() - parentSize.height() ) < eps ) );
    bool  init = ( parentSize.width() <= 0 );
    parentSize = size;

    if ( doesFit || init )
    {
        transform->rescale( false );
    }

    setMinimumSize( getMinimumPixmapSize() ); // for the scrollbars
    setMaximumSize( getMinimumPixmapSize() );
}
MToolsWidgetAbstract::MToolsWidgetAbstract(bool using_longtap, QGraphicsObject *parent):
    MImageWidget(parent)
{
    setMaximumSize(64,64);
    setMinimumSize(64,64);
    setAspectRatioMode(Qt::KeepAspectRatio);

    feedback_press = new MFeedback("priority2_static_press", this);
    feedback_release = new MFeedback("priority2_static_release", this);
    feedback_long = new MFeedback("priority2_grab", this);

    GConfItem *theme = new GConfItem("/meegotouch/theme/CurrentMeegoTheme", this);
    currentTheme = theme->value("blanco").toString();
    theme->deleteLater();

    if (using_longtap)
        grabGesture(Qt::TapAndHoldGesture);
}
composition_view_toolbar_t::composition_view_toolbar_t( composition_view_t *comp_view) : QWidget()
{
    comp_view_ = comp_view;

    setMinimumSize( 0, toolbar_height());
    setMaximumSize( QWIDGETSIZE_MAX, toolbar_height());
    setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed);

	/*
    QHBoxLayout *horizontalLayout = new QHBoxLayout( this);
    horizontalLayout->setContentsMargins( 0, 0, 0, 0);
	
	QSpacerItem *horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
	horizontalLayout->addItem( horizontalSpacer);

    setLayout( horizontalLayout);
	*/
}